Drilling Speed and Depth Computation for Downhole Tools

ABSTRACT

A method for managing a drilling operation, including generating, by a first sensor and a second sensor of a bottom hole assembly (BHA), a first time based data log and a second time based data log, respectively, representing a borehole parameter along a drilling trajectory, determining, by a computer processor of the BHA and during the drilling operation, a time shift by comparing the first time based data log and the second time based data log, where offsetting the first and second time based data logs by the time shift maximizes a correlation factor of the first and second time based data logs, and determining, within a pre-determined time period from generating the first and second time based data logs, a drilling speed based on the time shift and a pre-determined distance between the first sensor and the second sensor.

BACKGROUND

In various drilling and logging operations, it is desirable that thedrilling speed or ROP (rate of penetration) is available to the downholetools. Conventionally, ROP and measured depth are available only at thesurface due to limited computational resources in downhole tools.Downhole ROP estimation methods based on downhole accelerometer data areavailable but not reliable due to harsh downhole conditions (e.g.,shocks and vibrations). Furthermore, there is a trend in the industrytowards drilling deeper wells with smaller diameters where downholeconditions become increasingly problematic.

SUMMARY

In general, in one aspect, the invention relates to a method formanaging a drilling operation in a subterranean formation. The methodincludes generating, by a first sensor of a bottom hole assembly (BHA)and during the drilling operation, a first time based data logrepresenting a borehole parameter along a drilling trajectory,generating, by a second sensor of the BHA during the drilling operation,a second time based data log representing the borehole parameter alongthe drilling trajectory, determining, by a computer processor of the BHAand during the drilling operation, a time shift by comparing the firsttime based data log and the second time based data log, whereinoffsetting the first and second time based data logs by the time shiftmaximizes a correlation factor of the first and second time based datalogs, determining, within a pre-determined time period from generatingthe first and second time based data logs, a drilling speed based on thetime shift and a pre-determined distance between the first sensor andthe second sensor, and performing the drilling operation based on thedrilling speed.

Other aspects of the invention will be apparent from the followingdetailed description and the appended claims.

BRIEF DESCRIPTION OF DRAWINGS

The appended drawings illustrate several embodiments of drilling speedand depth computation for downhole tools and are not to be consideredlimiting of its scope, for drilling speed and depth computation fordownhole tools may admit to other equally effective embodiments.

FIG. 1 is a schematic view of a wellsite depicting a drilling operationin which one or more embodiments of drilling speed and depth computationfor downhole tools may be implemented.

FIG. 2 shows a system for drilling speed and depth computation inaccordance with one or more embodiments.

FIG. 3 depicts an example flowchart of drilling speed and depthcomputation for downhole tools in accordance with one or moreembodiments.

FIGS. 4.1-4.11 depict examples of drilling speed and depth computationfor downhole tools in accordance with one or more embodiments.

FIG. 5 depicts a computer system using which one or more embodiments ofdrilling speed and depth computation for downhole tools may beimplemented.

DETAILED DESCRIPTION

Aspects of the present disclosure are shown in the above-identifieddrawings and described below. In the description, like or identicalreference numerals are used to identify common or similar elements. Thedrawings are not necessarily to scale and certain features may be shownexaggerated in scale or in schematic in the interest of clarity andconciseness.

Aspects of the present disclosure include a method, system, and computerreadable medium that address the aforementioned drawbacks of prior artROP and depth estimation methods. In one or more embodiments, sensors ofsimilar kind are placed at a known distance apart in a downhole bottomhole assembly (BHA) such that time based data logs collected at twodifferent locations are compared to compute a time shift resulting inmaximum correlation between the time-shifted data logs. Accordingly,near-instantaneous ROP and depth are calculated from the time shift andthe known sensor separation distance.

FIG. 1 is a schematic view of a wellsite (100) depicting a drillingoperation. The wellsite (100) includes a drilling system (311) and asurface unit (334). In the illustrated embodiment, a borehole (313) isformed by rotary drilling in a manner that is well known. Those ofordinary skill in the art given the benefit of this disclosure willappreciate, however, that the present invention also finds applicationin drilling applications other than conventional rotary drilling (e.g.,mud-motor based directional drilling), and is not limited to land-basedrigs.

The drilling system (311) includes a drill string (315) suspended withinthe borehole (313) with a drill bit (310) at its lower end. The drillingsystem (311) also includes the land-based platform and derrick assembly(312) positioned over the borehole (313) penetrating a subterraneanformation (F). The assembly (312) includes a rotary table (314), kelly(316), hook (318) and rotary swivel (319). The drill string (315) isrotated by the rotary table (314), energized by means not shown, whichengages the kelly (316) at the upper end of the drill string. The drillstring (315) is suspended from hook (318), attached to a traveling block(also not shown), through the kelly (316) and a rotary swivel (319)which permits rotation of the drill string relative to the hook.

The drilling system (311) further includes drilling fluid or mud (320)stored in a pit (322) formed at the well site. A pump (324) delivers thedrilling fluid (320) to the interior of the drill string (315) via aport in the swivel (319), inducing the drilling fluid to flow downwardlythrough the drill string (315) as indicated by the directional arrow.The drilling fluid (320) exits the drill string (315) via ports in thedrill bit (310), and then circulates upwardly through the region betweenthe outside of the drill string (315) and the wall of the borehole(313), called the annulus (326). In this manner, the drilling fluid(320) lubricates the drill bit (310) and carries formation cuttings upto the surface as it is returned to the pit (322) for recirculation.

The drill string (315) further includes the BHA (330), near the drillbit (310) (in other words, within several drill collar lengths from thedrill bit). The BHA (330) includes capabilities for measuring,processing, and storing information, as well as communicating with thesurface unit. The BHA (330) further includes drill collars (328) forperforming various other measurement functions. In particular, the BHA(330) includes the drilling speed and depth computation tool (200).

Sensors (S) are located about the wellsite to collect data, may be inreal time, concerning the operation of the wellsite, as well asconditions at the wellsite. The sensors (S) may also have features orcapabilities, of monitors, such as cameras (not shown), to providepictures of the operation. Surface sensors or gauges (S) may be deployedabout the surface systems to provide information about the surface unit,such as standpipe pressure, hook load, depth, surface torque, rotaryrpm, among others. Downhole sensors or gauges (S) are disposed about thedrilling tool and/or wellbore to provide information about downholeconditions, such as wellbore pressure, weight on bit, torque on bit,direction, inclination, collar rpm, tool temperature, annulartemperature and toolface, among others. Multiple downhole sensors (S)may be located at different positions on BHA (330), such as sensor (201)and sensor (202). The information collected by the sensors and camerasis conveyed to the various parts of the drilling system and/or thesurface unit (334).

The drilling system (311) is operatively connected to the surface unit(334) for communication therewith. The BHA (330) is provided with acommunication subassembly (352) that communicates with the surface unit.The communication subassembly (352) is adapted to send signals to andreceive signals from the surface using mud pulse telemetry. Thecommunication subassembly (352) may include, for example, a transmitterthat generates a signal, such as an acoustic or electromagnetic signal,which is representative of the measured drilling parameters. It will beappreciated by one of skill in the art that a variety of telemetrysystems may be employed, such as mud pulse telemetry, wired drill pipe,electromagnetic or other known telemetry systems.

Typically, the wellbore is drilled according to a drilling plan that isestablished prior to drilling. The drilling plan typically sets forthequipment, pressures, trajectories and/or other parameters that definethe drilling process for the wellsite. The drilling operation may thenbe performed according to the drilling plan. However, as information isgathered, the drilling operation may deviate from the drilling plan.Additionally, as drilling or other operations are performed, thesubsurface conditions may change. The earth model may also be adjustedas new information is collected.

For example, instantaneous ROP can be used to determine the proportionalgain to use in a closed-loop drilling system so that automatedtrajectory control of a steerable drilling tool may become more preciseduring the drilling operation through different formations. Also, thedrilled depth downhole (computed by integrating a drilling speed over acertain time period) can be used to compute the drilling trajectorydownhole. Another useful application includes logging-while-drilling(LWD) imaging, where image recording intervals or telemetry intervalscan be controlled, depending upon the drilling speed. Overall, theability to compute ROP downhole dramatically improves the quality ofdownhole steering automation when used with, for example,rotary-steerable systems, coiled tubing system, and/or rotary-steerablemotor tools.

Although the subterranean assets are not limited to hydrocarbons such asoil, throughout this document, the terms “oilfield” and “oilfieldoperation” may be used interchangeably with the terms “field” and “fieldoperation” to refer to a site where any type of valuable fluids can befound and the activities required for extracting them. The terms mayalso refer to sites where substances are deposited or stored byinjecting them into the surface using boreholes and the operationsassociated with this process. Further, the term “field operation” refersto a field operation associated with a field, including activitiesrelated to field planning, wellbore drilling, wellbore completion,and/or production using the wellbore.

FIG. 2 is a schematic view of the BHA (330) with more details. In one ormore embodiments of the invention, one or more of the modules andelements shown in FIG. 2 may be omitted, repeated, and/or substituted.Accordingly, embodiments of drilling speed and depth computation fordownhole tools should not be considered limited to the specificarrangements of modules shown in FIG. 2.

As shown in FIG. 2, the BHA (330) includes a first sensor (201), asecond sensor (202), and a drilling speed and depth computation tool(200). In one or more embodiments, the first sensor (201) is configuredto generate, during a drilling operation, a first time based data log(211) representing a borehole parameter along a drilling trajectory thatforms the borehole (313) of FIG. 1 above. Further, the second sensor(202) is configured to generate, during the drilling operation, a secondtime based data log (212) representing the borehole parameter along thedrilling trajectory. For example, the borehole parameter may be adiameter of the borehole, a porosity of the formation rocks near theborehole, borehole inclination, total magnetic field, etc. In one ormore embodiments, the first sensor (201) and the second sensor (202) arepositioned at different locations on the BHA (330) and are separated bya distance (i.e., distance (203) shown in FIG. 1). In one or moreembodiments, the first sensor (201) and the second sensor (202) are of asimilar type. Throughout this disclosure, the term “similar type” or“similar kind” refers to at least one borehole parameter that can bemeasured by both the first sensor (201) and the second sensor (202). Inparticular, features in the borehole parameter profile along theborehole can be detected by both the first sensor (201) and the secondsensor (202) such that the resultant data logs can be correlated betweenthem. Specifically, the correlation is maximized when the resultant datalogs are shifted with respect to each other, by a time shift on the timescale. As described later in reference to the drilling speed calculator(221), this time shift is used to calculate the drilling speed.

In one or more embodiments, the first sensor (201) and the second sensor(202) include imaging sensors. For example, the first sensor (201) maybe a neutron imaging sensor while the second sensor (202) may be anacoustic imaging sensor. In another example, the first sensor (201) maybe a mechanical caliper sensor while the second sensor (202) may be anacoustic caliper sensor. Although they are different types of sensors,they are of a similar type or a similar kind because they both canmeasure the borehole diameter and detect features (e.g., a protrusion ofborehole surface) in the borehole diameter profile along the borehole.

In one or more embodiments, the first sensor (201) and the second sensor(202) include navigational sensors (e.g., accelerometers, magnetometers,gyros, etc.) and the resultant data logs include their navigationalinformation (such as inclination, azimuth, total magnetic field, etc).In addition to the data logs, intermediate computational values fromnavigation sensors (i.e., the first sensor (201) and the second sensor(202)) may also be used to identify correlation. For example, axialaccelerometer readings from the first sensor (201) and the second sensor(202) at two different axial locations (with a pre-determined axialoffset) in the BHA (330) may be matched/correlated to determine the timeshift between them to maximize the matching/correlation. The followingformulae are well-known in the art:

Inclination=arc cos(G _(z)/TGF), where TGF stands for total gravityfield

Inclination=ar cos(G _(z)), where TGF=1G(9.8 m/s²)

Inclination=arc sin(G _(xy)/TGF)

Inclination=arc sin(G _(xy)), where TGF=1G(9.8 m/s²)

G_(z) is an axial accelerometer reading (e.g., as shown in FIG. 4.8).G_(xy) is a transverse (cross-axial) accelerometer reading, computedusing an equation G_(xy)=sqrt(G_(x) ²+G_(y) ²), where sqrt( ) is asquare root function. The axial accelerometer and/or transverseaccelerometer readings may be used for both static survey operation anddynamic survey operation, whether the sensor (along with thedrillstring) is rotating or not. In general, the static survey providesmore accurate data but requires logistic planning in stopping thedrilling operation. One or more filters (e.g., average filter, medianfilter, low-pass filter) known in the art may be applied to the axialand/or transverse accelerometer readings to minimize the noise effectfrom downhole vibration/shock when the data are taken during thedrillstring rotation.

Likewise, axial and transverse magnetometer readings may also be used ina similar manner (e.g., as shown in FIG. 4.10). Generally, totalmagnetic field (TMF) may be used for drilling speed and depthcomputation (e.g., as shown in FIG. 4.11). TMF may be computed in thefollowing equation. TMF=sqrt (B_(x) ²+B_(y) ²+132), where B_(x), B_(y),and B_(z) are the x-, y- and z-axis magnetometer readings and sqrt( ) isa mathematical square-root function. In some areas, TMF changes withformation types (ferros or magnetic formation).

In other cases, especially in SAGD (steamed-assisted gravity drainage),a twin well is placed parallel to the first well, where casing magneticinterference are present while drilling. In this (SAGD) case, themagnetic interference magnitude (using TMF) and the interferencemagnetic field vector may uniquely change based on the axial position onthe wellbore (e.g., as shown in FIG. 4.10). Two or more sets ofmagnetometers may be deployed and by matching/correlating theirreadings, downhole drilling speed and depth may be determined.Alternatively, the parameters, computed with tri-axial magnetometers,such as magnetic dip angles and azimuth, may be equally used to matchtheir data points since magnetometer data have magnetic interference,generating a particular signature at certain depth.

To give an example, in a J-well or a S-well, the first sensor (201) is anavigation sensor in an RSS (rotary steerable system) measuringparticular inclination and azimuth. The second sensor (202) is anothernavigation sensor in an MWD tool (about 50-100 ft away) measuring sameinclination and azimuth where the RSS previously passed. In practice,the borehole (313) is never a perfectly straight hole and this sensorcombination is also applicable for any typical vertical well and/orhorizontal well. FIGS. 4.7 and 4.9 show the use of inclination andazimuth of the borehole to determine the drilling speed. The azimuth ofthe well may be computed in the following equations well known in theart:

${{Azi}\; 1} = {\arctan \left( \frac{\left( {{{Gx}\; 1*{By}\; 1} - {{Gy}\; 1*{Bx}\; 1}} \right)*\sqrt{{{Gx}\; 1^{2}} + {{Gy}\; 1^{2}} + {{Gz}\; 1^{2}}}}{{{Bz}\; 1*\left( {{{Gx}\; 1^{2}} + {{Gy}\; 1^{2}}} \right)} - {{Gz}\; 1*\left( {{{Gx}\; 1*{Bx}\; 1} - {{Gy}\; 1*{By}\; 1}} \right)}} \right)}$

Where G_(x), G_(y), and G_(z) are the x-, y- and z-axis accelerometerreadings respectively, and B_(x), B_(y), and B_(z) are the x-, y- andz-axis magnetometer readings respectively. There are also alternativeequations available to those who are skilled in the arts.

Suitable accelerometers for use in navigation sensors may be chosen fromamong substantially any suitable commercially available devices known inthe art. For example, suitable accelerometers may include Part Number979-0273-001 commercially available from Honeywell, and Part NumberJA-5H175-1 commercially available from Japan Aviation ElectronicsIndustry, Ltd. (JAE). Suitable accelerometers may alternatively includemicro-electro-mechanical systems (MEMS) solid-state accelerometers,available, for example, from Analog Devices, Inc. (Norwood, Mass.). SuchMEMS accelerometers may be advantageous for certain near bit sensor subapplications since they tend to be shock resistant, high-temperaturerated, and inexpensive. Suitable magnetic field sensors may includeconventional ring core flux gate magnetometers or conventionalmagneto-resistive sensors, for example, Part Number HMC-1021D, availablefrom Honeywell.

In one or more embodiments, the first sensor (201) and the second sensor(202) further include a formation pressure senor, a downhole camera, anda temperature sensor. Additional example data logs of sensors of similartype are described in reference to FIGS. 4.1-4.6 below.

In one or more embodiments, the drilling speed and depth computationtool (200) includes a drilling speed calculator (221), a drillingparameter calculator (222), and a repository (210). In one or moreembodiments, the repository (210) is a downhole memory module known tothose skilled in the art. Specifically, the downhole memory has limiteddensity and capacity due to harsh downhole conditions. In one or moreembodiments, the repository (210) is configured to store the first timebased data log (211), the second time based data log (212), and thecalculated drilling information (213). Further, the repository (210) maybe shared by the drilling speed and depth computation tool (200) andother downhole tools, such as LWD imaging tools (not shown) via a commoncommunication bus (not shown). Several downhole computers may be used toprocess the sensor data and they may be connected in a commoncommunication bus. The repository (210) may be located anywhere in thedrill string (315), e.g., 10-100 ft away from the sensors (201) and(202). In one or more embodiments, the common communication bus may behard-wired among different tools or include a partially EM(electromagnetic) shorthop or any other wireless communication bus, suchas acoustic communication channels. Accordingly, the repository (210)may also be configured to store other data (not shown), such as LWDimages generated by the LWD imaging tools.

In one or more embodiments, the drilling speed calculator (221) isconfigured to determine, during the drilling operation, a time shift bycomparing the first time based data log (211) and the second time baseddata log (212). Specifically, the time shift is determined by offsettingthe first time based data log (211) and the second time based data log(212), for instance, to maximize a correlation factor. The method forfinding a match may utilize other methods than maximizing a correlationfactor. Such methods include maximizing a cross-correlation, minimizinga regression error, etc. In this context, the term “correlation factor”may be used to refer to the, cross-correlation coefficient, an inverseof the regression error, etc. For example, if both sensors (201) and(202) can detect features in the borehole diameter profile, the timeshift is determined by shifting (i.e., offsetting) the time scale of thefirst time based data log (211) against the second time based data log(212) to match respective peaks representing a protrusion in theborehole surface. Additional examples of determining the time shift aredescribed in reference to FIGS. 4.1-4.6 below.

In one or more embodiments, the drilling speed calculator (221) isconfigured to determine, within a pre-determined time period fromgenerating the first time based data log (211) and the second time baseddata log (212), a drilling speed based on the time shift and apre-determined distance between the first sensor (201) and the secondsensor (202). For example, the pre-determined distance may be thedistance (203), shown in FIG. 1, while the drilling speed is calculatedby dividing the distance (203) over the time shift. In one or moreembodiments, the calculation is performed by a computer processor (notshown) on the BHA (330) without transmitting any data log to the surfaceand incurring transmission delays (e.g., of mud pulse telemetry).Accordingly, the pre-determined time period may be one second, oneminute, or a time period substantially less than mud pulse telemetrytransmission delay to the surface. In particular, calculating drillingspeed within the pre-determined time period is referred to ascalculating near-instantaneous drilling speed or calculating thedrilling speed in real time. In one or more embodiments, the drillingspeed calculator (221) is further configured to determine, within thepre-determined time period, a drilling depth by at least mathematicallyintegrating the drilling speed over time.

In one or more embodiments, the drilling speed and depth computationtool (200) further includes a drilling parameter calculator (222) thatis configured to calculate various drilling parameters and store them ascalculated drilling information (213) in the repository (210). Forexample, the drilling parameter calculator (222) calculates, based onthe drilling speed and within the pre-determined time period, parameterssuch as build rate, turn rate, dogleg, effective gravity toolface, etc.Accordingly, a toolface and/or a steering ratio can be adjusted, inreal-time, based on at least one of these drilling parameters.

As is known to those skilled in the art, the toolface is the angle wherethe drill bit is pushing or pointing with respect to the earth's gravityfield. In directional drilling applications, “toolface=0 degree” refersto the opposite side of the gravity field. If the tool's demand toolfaceis set to 0 degree, the tool is expected to perform pure build.Similarly, “toolface=90 degrees,” “toolface=270 degrees,” and“toolface=180 degrees” correspond to pure right turn, pure left turn,and pure drop, respectively. The steering ratio (SR) corresponds to howsteep the curve is. For example, SR=0%, 50%, and 100% correspond toneutral drilling (no bias), 50% of the maximum curvature (or maximumdegleg), and the maximum curvature (maximum dogleg), respectively. Ingeneral, by controlling the toolface and the steering ratio, adirectional drilling system (e.g., a rotary steerable system,coiled-tubing system, rotary-steerable motor system, etc) can drill twoand three-dimensional wells.

There are various rotary steerable systems (RSS) available in themarket. Depending on the type of RSS, different control parameters(e.g., force vector toolface, pressure vector toolface, position vectortoolface, force vector magnitude, pressure vector magnitude, positionoffset magnitude, eccentric distance, etc.) may be used that areequivalent to the aforementioned control parameters, toolface andsteering ratio (or proportion).

In one or more embodiments, the drilling parameter calculator (222) isfurther configured to determine, during the drilling operation, constantdepth intervals based on the drilling speed. Constant depth intervalsare time intervals where the drill bit advances a constant depth duringeach of the intervals. In one or more embodiments, a downhole steerabledevice is adjusted to control a drilling trajectory periodically basedon these constant depth intervals. For example, the downhole steerabledevice may include a proportional controller, a proportional integralcontroller, or a proportional integral differential controller that isadjusted once in each of the constant depth intervals. Said in otherwords, the controllers used to control the trajectory of the downholesteerable tool include, but not limited to, a proportional controller, aproportional integral controller, or a proportional integraldifferential controller. These controllers require certain gains such asproportional gain, integral gain, differential gain, etc. These gainsmay be adjusted (e.g., increased or decreased) based on the drillingspeed computed downhole.

In one or more embodiments, the drilling parameter calculator (222) isfurther configured to determine, during the drilling operation, howoften to store output of a downhole imaging tool in the repository (210)and/or how often to send output of a downhole imaging tool to thesurface unit (334) via mud pulse telemetry. For example, when thedrilling speed is slow, the images can be stored downhole or sent tosurface less frequently to conserve limited downhole memory capacity andlimited mud pulse telemetry bandwidth.

Additional examples of calculating the drilling speed and other drillingparameters are described in reference to FIGS. 4.1-4.6 below.

FIG. 3 depicts an example method for drilling speed and depthcomputation for downhole tools in accordance with one or moreembodiments. For example, the method depicted in FIG. 3 may be practicedusing the drilling speed and depth computation tool (200) described inreference to FIGS. 1 and 2 above. In one or more embodiments, one ormore of the elements shown in FIG. 3 may be omitted, repeated, and/orperformed in a different order. Accordingly, embodiments of drillingspeed and depth computation for downhole tools should not be consideredlimited to the specific arrangements of elements shown in FIG. 3.

Initially in Block 301, a first time based data log and a second timebased data log are generated, during a drilling operation, by a firstsensor and a second sensor, respectively. Specifically, the first andsecond sensors are positioned on a bottom hole assembly (BHA) andseparated by a known distance. In one or more embodiments, the firstsensor and the second sensor are of similar type, such that both of thefirst and second time based data logs represent a borehole parameteralong a drilling trajectory. For example, the first and second sensorsmay be a neutron imaging senor and an acoustic imaging sensor,respectively, where both the neutron image and acoustic image containinformation of borehole diameter along the drilling trajectory.

In Block 302, a time shift is determined by comparing the first timebased data log and the second time based data log. In one or moreembodiments, the time shift is determined by a computer processor of theBHA and determined during the drilling operation. In one or moreembodiments, the time shift is determined such that offsetting the firstand second time based data logs by the time shift maximizes acorrelation factor of the first and second time based data logs. Forexample, if both the first and second sensors can detect features in theborehole diameter profile, the time shift is determined by shifting(i.e., offsetting) the time scale of the first time based data logagainst the second time based data log to match respective peaksrepresenting a protrusion in the borehole surface. Additional examplesof determining the time shift are described in reference to FIGS.4.1-4.6 below.

In Block 303, a drilling speed is determined based on the time shift andthe known (i.e., pre-determined) distance between the first sensor andthe second sensor. In one or more embodiments, the drilling speed isdetermined by the computer processor of the BHA during the drillingoperation and is referred to as downhole computed drilling speed ordownhole drilling speed. For example, the drilling speed may be computedby dividing the known distance between the sensors by the time shift.This represents an average rate of penetration that is averaged over thetime period for the drill bit to advance a distance equal to theseparation between the sensors. In or more embodiments, the drillingspeed is determined within a pre-determined time period from generatingthe first and second time based data logs. Because the computerprocessor of the BHA computes the drilling speed without incurring anytime delay of sending the data logs to the surface, the pre-determinedtime period can be a short time period such as a second, a minute, orany time period substantially shorter than the mud pulse telemetrytransmission delay to the surface. In this regard, the computed drillingspeed is referred to as near-instantaneous speed. Additional details ofcalculating the drilling speed are described in reference to FIGS.4.1-4.6 and Equations 1-8 below.

In Blocks 304 and 309, decisions are made as to whether the drill bit isrotating or the weight-on-bit exceeds a pre-determined threshold. Forexample, a downhole WOB (weight-on-bit) sensor and a drill-stringrotation detection sensor (such as gyro, accelerometers, andmagnetometers) may be used to make such determination. In one or moreembodiments, the depth tracking is stopped when the bit is off bottom(WOB is very low or zero) and/or when the bit is not rotating. Said inother words, if the determination in either Block 304 or Block 309 isno, the method proceeds to Block 308 where the drilling speed is resetto zero before the method continues to Block 305; if the determinationin Blocks 304 and 309 are both yes, the method proceeds directly toBlock 305 where the drilling speed is mathematically integrated tocompute a distance of drill bit penetration over an integration timeperiod. If the BHA does not contain the near-bit WOB sensor,alternatively, only the rotation detection sensor may be used. Also,vibration and shock sensors may alternatively be used to detect drillingand non-drilling status. For example, if the vibration level is lessthan a predetermined threshold, then the drilling speed may be reset tozero or certain pre-determined level that is substantially zero. In oneor more embodiments, this non-drilling-detection feature is used toprevent the tool from accumulating depth tracking errors, to reducedownhole communication bandwidth, memory usage, and computationalresources, and/or to yield these precious resources to other features.Accordingly, a depth (referred to as downhole measured depth (MD)) isdetermined based on a known starting depth and the computed distance ofdrill bit penetration. For example, the starting depth may be based on asurface MD downlinked (e.g., transmitted via the mud pulse telemetry) tothe computer processor of the BHA.

From time to time, errors may accumulate in the downhole MD due toinaccuracies in determining the time shift and integrating the computeddrilling speed. In Block 306, the downhole MD is periodically calibrated(i.e., adjusted) based on surface MD. In one or more embodiments, thesurface MD is downlinked periodically (e.g., once every hour) andcompared with the downhole MD. Any discrepancy between the surface MDand the downhole MD may then be analyzed to determine an error, which isused to correct the downhole MD. Due to the limited bandwidth ofdownlink (e.g., mud pulse telemetry), the surface MD is availablesubstantially less frequent than the downhole MD. Said in other words,downlinking the surface MD is substantially less frequent than how oftenthe near-instantaneous drilling speed is computed and integrated tocompute the downhole MD.

In one or more embodiments, Blocks 305 and 306 may be omitted to controla downhole tool based on drilling speed without computing the depthparameter. In such embodiments, Block 308 or 309 may proceed directly toBlock 307 described below.

In Block 307, additional drilling parameters are computed based at leaston the drilling speed and/or the downhole MD. For example, the drillingparameters may include build rate, turn rate, dogleg, effective gravitytoolface, etc., which can be computed from the drilling speed and/ordownhole MD using formulae known to those skilled in the art. Theseformulae may also use other parameters (e.g., BHA inclination, azimuth,magnetic dip, magnetic toolface, gravity toolface, total magnetic field,total gravity field, etc.) measured using other downhole tools of theBHA. In one or more embodiments, the drilling operation is adjustedbased on the downhole drilling speed and/or other computed drillingparameters. For example, a toolface and/or a steering ratio can beadjusted, in real-time, based on at least one of these drillingparameters. In another example, constant depth intervals may bedetermined based on the downhole drilling speed. Constant depthintervals are time intervals where the drill bit advances a constantdepth during each of the intervals. In one or more embodiments, adownhole steerable device is adjusted to control a drilling trajectoryperiodically based on these constant depth intervals. For example, thedownhole steerable device may include a proportional controller, aproportional integral controller, or a proportional integraldifferential controller that is adjusted once in each of the constantdepth intervals. In yet another example, the downhole drilling speed maybe used to determine, during the drilling operation, how often to storeoutput of a downhole imaging tool in the downhole memory and/or howoften to send output of a downhole imaging tool to the surface unit viamud pulse telemetry. For example, when the drilling speed is slow, theimages can be stored downhole or sent to surface less frequently toconserve limited downhole memory capacity and limited mud pulsetelemetry bandwidth.

Additional details of computing drilling parameters to control thedrilling operation are described in reference to FIGS. 4.1-4.6 andEquations 9-16 below.

FIGS. 4.1-4.11 depict examples of drilling speed and depth computationfor downhole tools in accordance with one or more embodiments. Forexample, the example depicted in FIGS. 4.1-4.11 may be practiced usingthe drilling speed and depth computation tool (200) described inreference to FIGS. 1 and 2 above.

FIG. 4.1 shows borehole caliper data measured at two different locationsin the same BHA. Specifically, borehole diameter information (411) isfrom a time based data log of RSS caliper data (near-bit mechanicalcaliper data) and acoustic standoff caliper data obtained with a DNSC(density neutron standoff caliper) tool. In particular, the boreholediameter information (411) is based on near-bit mechanical caliper datafrom RSS showing a borehole diameter reduction at 0:03:00 on thehorizontal time scale. In addition, borehole diameter information (412)is from a time based data log of LWD acoustic standoff caliper toolshowing a borehole diameter reduction at 0:11:00 on the same horizontaltime scale. The separation between 0:03:00 and 0:11:00 on the horizontaltime scale is referred to as the time shift t. The RSS sensor and theLWD sensor are physically positioned on the BHA with a separationdistance d. One skilled in the art will appreciate that even thoughborehole diameter information (411) and borehole diameter information(412) do not agree exactly, the two data log can be shifted (offset) bytime t to achieve a match based on a dipping shape indicating theborehole diameter reduction. For example, the borehole might be furtheropened up or washed out by the mud flow, cuttings, and/or stabilizercontacts, the near-bit RSS caliper (typically measured approximately 2-3ft away from the drill bit) is generally smaller than or equal to theacoustic caliper readings (typically measured approximately 50-100 ftaway from the drill bit). This is an example showing the sensor typeswith a known separation (d) do not have to be exactly the same toproduce a correlation between the resultant data logs. The mechanicalcaliper at RSS and the acoustic caliper at LWD deploy fundamentallydifferent physics/hardware to measure a similar quantity. Therefore thesensor set does not have to be the same kind, but “similar” kind. Othersimilar kinds of sensors include those measuring Gamma counts,inclination, azimuth, temperature, formation pressure, caliper,standoff, LWD images, etc.

In the above example, the RSS, MWD, and LWD tool are connected via acommon communication bus on the BHA. The communication bus may includeEM shorthop as a partial passage. Any other shorthop telemetry withinthe BHA may be used, including acoustic shorthop communication, mudtelemetry shorthop communication, etc. The drilling speed and depthcomputation tool (200) of FIGS. 1 and 2 may be integrated with the RSStool, integrated with the LWD tool, or a stand alone tool in thecommunication bus. In the third case, the drilling speed and depthcomputation tool (200) may be a bus master that can communicate withboth RSS and LWD tools via the communication bus. Further, the drillingspeed may be computed by the downhole computer and transmitted viahigh-speed wired-drill-pipe telemetry to the surface. Then, the downholedrilling speed can be used to obtain more accurate surface-computeddepth (measured depth). It is well known that drill pipe can becompressed and stretched and the surface measurement of depth may not beaccurate without comparison with downhole computed drilling speed.

FIG. 4.2 shows determining the time shift between two time-based datalogs that maximizes a correlation function. Specifically, FIG. 2 showsthe Pearson's correlation, r, between the two caliper data sets shown inFIG. 4.1 as a function of an offset, t, in the time scale between thetwo caliper data sets. As shown in FIG. 4.2, a maximum of the Pearson'scorrelation, r, between the two caliper data sets occurs when the offsetequals 0:08:45 or 525 seconds, which is determined as the time shiftusing the method shown in FIG. 3 above.

As is known to those skilled in the art, the correlation between twovariables reflects the degree to which the variables are related. Acommon measure of correlation is the Pearson Product Moment Correlation,or Pearson's correlation that reflects the degree of linear relationshipbetween two variables. It ranges from +1 to −1. A correlation of +1means that there is a perfect positive linear relationship betweenvariables. Equation 1 shows the formula to compute the Pearson'scorrelation r as a function of the current time T and the time shift t.

$\begin{matrix}{r_{T} = \frac{\sum\limits_{t = 1}^{N}\; {\left( {{X\lbrack T\rbrack} - \overset{\_}{X}} \right)\left( {{Y\left\lbrack {T - t} \right\rbrack} - \overset{\_}{Y}} \right)}}{\sqrt{\left( {{X\lbrack T\rbrack} - \overset{\_}{X}} \right)^{2}}\sqrt{\left( {{Y\left\lbrack {T - t} \right\rbrack} - \overset{\_}{Y}} \right)^{2}}}} & {{Equation}\mspace{14mu} 1}\end{matrix}$

In equation 1, N is the number of data points in each of the time baseddata logs, X[ ] is an array from time based data log 1 having arrayelements indexed by t=1 . . . N on the time scale of the data log, Y[ ]is an array from time based data log 2 having array elements indexed byt=1 . . . N on the time scale of the data log, X is a mean value of X[], Y is a mean value of Y[ ].

The time shift t that maximizes the Pearson's correlation r isrepresented in Equation 2.

t=argmax_(t→N)(r _(T))   Equation 2

Equations 3-6 are simplified formulae to estimate the time shift t thatoptimizes (e.g., maximizes) various simplified correlation functionsbetween the two data logs.

t=argmax_(t→N)(Σ_(t=1) ^(N)(X[T]·Y[T−t]))   Equation 3

Because calculating the Pearson's correlation using equations 1-3requires computation resources not typically available downhole, thefollowing simplified regression equations are used to find best matchbetween two sensor arrays' data logs considering computing resourcelimitations of downhole computer.

$\begin{matrix}{t = {{argmin}_{t\rightarrow N}\left( \frac{\sqrt{\sum\limits_{t = 1}^{N}\; \left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)^{2}}}{N} \right)}} & {{Equation}\mspace{14mu} 4} \\{t = {{argmin}_{t\rightarrow N}\left( {\sum\limits_{t = 1}^{N}\; \left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)^{2}} \right)}} & {{Equation}\mspace{14mu} 5} \\{t = {{argmin}_{t\rightarrow N}\left( {\sum\limits_{t = 1}^{N}\; {{abs}\left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)}} \right)}} & {{Equation}\mspace{14mu} 6}\end{matrix}$

where abs( ) is an absolute value operator:

${a} = \left\{ \begin{matrix}{a,} & {{{if}\mspace{14mu} a} \geq 0} \\{{- a},} & {{{if}\mspace{14mu} a} < 0.}\end{matrix} \right.$

These simplified formulae may be used by the drilling speed and depthcomputation tool (200) of FIG. 2 or in the method Block 302 of FIG. 3above. Once the time shift, t, is determined, the near-instantaneous ROPat a given time T can be estimated based on the average drilling speedcalculated using Equation 7 below, where d and t are the sensorseparation distance and time shift described above.

ROP[T]=d/t   Equation 7

Accordingly, the displacement, Disp, at a given time T can be estimatedby mathematically accumulating discrete ROP using Equation 8 below,where t is a time index on the time scale of the data log. Those skilledin the art will appreciate that as the number of data points in the datalog increases to a large number, the discrete summation approximates amathematical integral.

Disp[T]=Σ _(t=0) ^(T)ROP[t]  Equation 8

FIGS. 4.3-4.4 show imaging logs representing RHOB (bulk density) and PE(photo electric), respectively. FIGS. 4.5-4.6 show the standoff imageswith redundant acoustic sensors on the same BHA. The sensors generatingthese imaging logs are located with a known separation and created nearidentical two dimensional images. In this example, each two dimensionalimage is a collection of 32 one dimensional data logs corresponding to32 azimuthal angles in the borehole. Those skilled in the art willappreciate that equations 1-6 above can be applicable tomulti-dimensional data log considering X[ ] and Y[ ] asmulti-dimensional arrays. Also, LWD (or other formation evaluationsensor) data and MWD (or other navigational sensor) data may be bothprocessed at the same time to increase the confidence and accuracy ofthe drilling speed and/or depth computation.

FIG. 4.7 shows inclination data measured at two different locations inthe same BHA, using a RSS sensor and a MWD (navigational) sensor thatare physically positioned on the BHA with a separation distance d. Oneskilled in the art will appreciate that even though first inclinationinformation (Inc1) and second inclination information (Inc2) do notagree exactly, the two data logs can be shifted (offset) by time t₁ toachieve a match based on a non-uniform inclination-change. Here, X axisis time or discrete time index and Y axis is inclination in degrees.

FIG. 4.8 shows axial accelerometer data measured at two differentlocations in the same BHA, using a RSS sensor and a MWD (navigational)sensor that are physically positioned on the BHA with a separationdistance d. The axial accelerometer data may be considered anintermediate value to compute borehole inclination and closely relatedto the inclination change. One skilled in the art will appreciate thateven though axial accelerometer information (G_(z1)) and axialaccelerometer information (G_(z2)) do not agree exactly, the two datalogs can be shifted (offset) by time t₁ to achieve a match based on anon-uniform axial-accelerometer change. Here, X axis is time or discretetime index and Y axis is acceleration in units of G, where 1G=9.8 m/s²

FIG. 4.9 shows azimuth data measured at two different locations in thesame BHA, using a RSS sensor and a MWD (navigational) sensor that arephysically positioned on the BHA with a separation distance d. Oneskilled in the art will appreciate that even though first boreholeazimuth information (Azi1) and first borehole azimuth information (Azi2)do not agree exactly, the two data logs can be shifted (offset) by timet₁ to achieve a match based on a non-uniform azimuth change. Here, Xaxis is time or discrete time index and Y axis is azimuth in degrees.

FIG. 4.10 shows axial magnetometer data measured at two differentlocations in the same BHA, using a RSS sensor and a MWD (navigational)sensor that are physically positioned on the BHA with a separationdistance d. The axial magnetometer data may be considered anintermediate value to compute borehole azimuth and closely related tothe inclination and azimuth change. One skilled in the art willappreciate that even though axial magnetometer information (B_(z1)) andaxial magnetometer information (B_(z2)) do not agree exactly, the twodata logs can be shifted (offset) by time t₁ to achieve a match based ona non-uniform axial magnetometer reading change. Here, X axis is time ordiscrete time index and Y axis is magnetic field strength in gauss.

FIG. 4.11 shows total magnetic field (TMF) data measured at twodifferent locations in the same BHA, where magnetic interference ispresent (e.g. from the near-by casing, etc.), using a RSS sensor and aMWD (navigational) sensor that are physically positioned on the BHA witha separation distance d. One skilled in the art will appreciate thateven though borehole TMF information in the two data logs do not agreeexactly, the two data logs can be shifted (offset) by time t₁ to achievea match based on a non-uniform TMF shape. Here, X axis is time ordiscrete time index and Y axis is magnetic field strength in gauss.

As shown in the example scenarios above, the drilling speed and depthcomputation tool (200) of FIG. 2 or the method of FIG. 3 makes use ofthe existing sensor sets (e.g., RSS mechanical caliper vs. LWD acousticstandoff data, RSS [azimuthal] gamma vs. LWD/MWD [azimuthal] gamma data,RSS survey data vs. MWD survey data, etc.) on the BHA and does notrequire any additional dedicated sensor sets and/or dedicated mechanicalcomponents (magnetizers and/or counter wheels). With a downhole softwarerevision, the LWD sub can be used for dual purposes, namely (1) a LWDimaging sensor, and (2) a dedicated ROP calculator.

Once downhole ROP is obtained in the example above, the proportionalgain of the automated RSS trajectory control system may be adjustedbased on the drilling speed. Also, by combining the computed depth withthe RSS survey data (near-bit inclination and azimuth), the RSS computermay be able to compute accurate well positions downhole. Further, thelogging speed and telemetry speed (data update frequency) may bemodified depending upon the computed ROP. Overall, by knowing ROPdownhole, the quality of Downhole Steering Automation (e.g., used withrotary-steerable systems) can be improved as illustrated by the examplesbelow.

Downhole Computed Depth

The (drill string or measured) depth (denoted as “Depth”) at a giventime T can be updated with the displacement at a given time T as shownin Equation 9 and is referred to as downhole computed depth or downholemeasure depth (MD).

Depth [T]=Depth [T−1]+Disp [T]  Equation 9

Further, downhole MD may be periodically synchronized (updated) with thesurface MD in order to avoid error accumulation. This synchronizationcan be done, for example, by downlinking the surface MD to the downholetool periodically (e.g., every hour, or every 200 feet, etc). Also, thiscorrelation-based ROP and depth computation method may be combined withother known methods, such as with downhole counter wheels,accelerometer-based methods, and so on.

Real-Time Survey During the Drilling Operation

One effective use of the downhole MD is to determine the turn and buildrate of a directional drilling system downhole in real time. This isespecially useful if a downhole tool is continuously adjusting toolfaceand steering ratio in order to obtain a desired directional drillingresponse characterized by the build rate, turn rate, dogleg, andeffective gravity toolface, which can be computed using Equations 10-14below, where D is an intermediate value for calculating Dogleg.

$\begin{matrix}{{BuildRate} = {\left( {{{Inc}\lbrack T\rbrack} - {{Inc}\left\{ {T - t} \right\rbrack}} \right)/\left( {{{Depth}\lbrack T\rbrack} - {{Depth}\left\lbrack {T - t} \right\rbrack}} \right)}} & {{Equation}\mspace{14mu} 10} \\{{TurnRate} = {\left( {{{Azi}\lbrack T\rbrack} - {{Azi}\left\{ {T - t} \right\rbrack}} \right)/\left( {{{Depth}\lbrack T\rbrack} - {{Depth}\left\lbrack {T - t} \right\rbrack}} \right)}} & {{Equation}\mspace{14mu} 11} \\{D = {\arccos \left\lbrack {{{\cos \left( {{{Azi}\lbrack T\rbrack} - {{Azi}\left\lbrack {T - t} \right\rbrack}} \right)}{\sin \left( {{Inc}\left\lbrack {T - t} \right\rbrack} \right)}{\sin \left( {{Inc}\lbrack T\rbrack} \right)}} + {{\cos \left( {{Inc}\lbrack T\rbrack} \right)}{\cos \left( {{Inc}\left\lbrack {T - t} \right\rbrack} \right)}}} \right\rbrack}} & {{Equation}\mspace{14mu} 12} \\{\mspace{79mu} {{Dogleg} = {D/\left( {{{Depth}\lbrack T\rbrack} - {{Depth}\left\lbrack {T - t} \right\rbrack}} \right)}}} & {{Equation}\mspace{14mu} 13} \\{{GravityToolFace} = {\arccos {\quad\left\lbrack {{\left( {{{\cos (D)}{\cos \left( {{Inc}\left\lbrack {T - t} \right\rbrack} \right)}} - {\cos \left( {{Inc}\lbrack T\rbrack} \right)}} \right)/{\sin \left( {{Inc}\left\lbrack {T - t} \right\rbrack} \right)}}{\sin (D)}} \right\rbrack}}} & {{Equation}\mspace{14mu} 14} \\{\mspace{79mu} {Or}} & \; \\{\mspace{79mu} {{BuildRate} = \frac{{{Inc}\; 2} - {{Inc}\; 1}}{d}}} & \; \\{\mspace{79mu} {{TurnRate} = \frac{{{Azi}\; 2} - {{Azi}\; 1}}{d}}} & \; \\{\mspace{79mu} {{{Inc}\; 1} = {\arctan\left( \frac{\sqrt{{{Gx}\; 1^{2}} + {{Gy}\; 1^{2}}}}{{Gz}\; 1} \right.}}} & \; \\{\mspace{79mu} {{{Inc}\; 2} = {\arctan\left( \frac{\sqrt{{{Gx}\; 2^{2}} + {Gy}^{2}}}{{Gz}\; 2} \right.}}} & \; \\{{{Azi}\; 1} = {\arctan \left( \frac{\left( {{{Gx}\; 1*{By}\; 1} - {{Gy}\; 1*{Bx}\; 1}} \right)*\sqrt{{{Gx}\; 1^{2}} + {{Gy}\; 1^{2}} + {{Gz}\; 1^{2}}}}{{{Bz}\; 1*\left( {{{Gx}\; 1^{2}} + {{Gy}\; 1^{2}}} \right)} - {{Gz}\; 1*\begin{pmatrix}{{{Gx}\; 1*{Bx}\; 1} -} \\{{Gy}\; 1*{By}\; 1}\end{pmatrix}}} \right)}} & \; \\{{{Azi}\; 2} = {\arctan \left( \frac{\left( {{{Gx}\; 2*{By}\; 2} - {{Gy}\; 2*{Bx}\; 2}} \right)*\sqrt{{{Gx}\; 2^{2}} + {{Gy}\; 2^{2}} + {{Gz}\; 2^{2}}}}{{{Bz}\; 2*\left( {{{Gx}\; 2^{2}} + {{Gy}\; 2^{2}}} \right)} - {{Gz}\; 2*\begin{pmatrix}{{{Gx}\; 2*{Bx}\; 2} -} \\{{Gy}\; 2*{By}\; 2}\end{pmatrix}}} \right)}} & \; \\{\mspace{79mu} {{ToolFace} = {\arccos \left\lbrack \frac{{{\cos \left( {{Inc}\; 1} \right)}{\cos (D)}} - {\cos \left( {{Inc}\; 2} \right)}}{{\sin \left( {{Iinc}\; 1} \right)}{\sin (D)}} \right\rbrack}}} & \; \\{\mspace{79mu} {{DogLeg} = \frac{D}{d}}} & \; \\{\mspace{79mu} {{where}\text{:}}} & \; \\{\mspace{79mu} {D = {\arccos \begin{bmatrix}{{\cos \left( {{{Azi}\; 2} - {{Azi}\; 1}} \right)}{\sin \left( {{Inc}\; 1} \right)}} \\{{\sin \left( {{Inc}\; 2} \right)} + {{\cos \left( {{Inc}\; 1} \right)}{\cos \left( {{Inc}\; 2} \right)}}}\end{bmatrix}}}} & \;\end{matrix}$

In these equivalent equations, Inc1 is the inclination of the well at afirst measured depth (MD1), Inc2 is the inclination of the well at asecond measured depth (MD2), Azi1 is the inclination of the well at MD1and Azi2 is the inclination of the well at MD2, Gx1, Gy1, and Gz1 arethe x-, y-, and z-axis accelerometer readings, respectively at MD1, Gx2,Gy2, and Gz2 are the x-, y-, and z-axis accelerometer readings,respectively at MD2, Bx1, By1, and Bz1 are the x-, y- and z-axismagnetometer readings respectively at MD1, Bx2, By2, and Bz2 are the x-,y- and z-axis magnetometer readings respectively at MD2. For example,MD1 and MD2 may correspond to two sensor locations at any particulartime point during the drilling operation.

Typically, three magnetometers and three accelerometers are used tomeasure the three components of the gravity vector and the earthmagnetic field vector in the sensor frame. The voltage outputs from theaccelerometers are denoted by Gx, Gy and Gz, corresponding to the threeorthogonal axes. Similarly the magnetometer outputs are Bx, By and Bz.In particular, z axis points down the axis of the tool and the y axis isdefined as being in line with the toolface.

Build rate and turn rate may be computed from time-domain data usingEquations 10 and 11 or alternatively from depth domain data using theequivalent equations based on data at MD1 and MD2.

In order to accomplish the directional drilling task, the operator needsto know the orientation of the bent section (i.e., in therotary-steerable BHA). The relationship between the directional sensorand the bent section is fixed for each bottom hole assembly. From thedirectional sensor measurement, the directional sensor tool face isknown. If the angular difference between the directional sensorreference point and the bent section is measured, then the operator canuse this measurement and the directional sensor tool face reading todetermine the orientation of the bent section.

Closed-Loop Gain Control

A common challenge in the automated steering of a downhole steerabledevice (e.g., RSS) is that the downhole computer generally does not knowthe drilling speed. As a result, the proportional controller (e.g., thegain) is not properly adjusted. If the downhole computer is able tocompute (or given) the current drilling speed (e.g. ROP), it caneffectively adjust the gain of the proportional controller used for theInclination and/or Azimuth Hold algorithm. In the Inclination and/orAzimuth Hold, the build rate (BR) and turn rate (TR) are computed in theequations 15 and 16 below.

BR=Kbr*ROP *(ΔInc)+DropTendency   Equation 15

TR=Ktr*ROP*(ΔAzi)+WalkTendency   Equation 16

In Equations 15 and 16, Kbr is the proportional controller gain forbuild rate control, Ktr is the proportional controller gain for turnrate control, ROP is the downhole computed drilling speed, ΔInc is thedifference between Target Inclination and Actual Inclination, ΔAzi isthe difference between Target Azimuth and Actual Azimuth, DropTendencyis the drop tendency of the bit/BHA, and WalkTendency is the walktendency of the bit/BHA, as these terms are understood by one skilled inthe art. Although only proportional gains are adjusted in the aboveexample, those skilled in the art, with the benefit of this disclosurewill appreciate that the same concept is equally applicable to integralgains, differential gains, etc. These equations are used when thecontrol of the steerable tool occurs at the fixed time interval and thegain is adjusted at the fixed time interval based on the drilling speed.Alternatively, the control of the steerable tool may occur at the fixeddepth interval without substantially changing the gains of thecontroller(s) based on the drilling speed.

Based on the BR and TR computed above, desired toolface and steeringratio (proportion) may be computed using the following equations.DropTendency and WalkTendency are assumed to be zero for clarity andsimplicity.

BR=Kbr*ROP*(ΔInc)

TR=Ktr*ROP*(ΔAzi)

Desired Toolface=arc tan 2(TR, BR)

Desired Proportion=sqrt((TR)²+(BR)²)

where ΔInc=Target Inc−Actual Inc

ΔAzi=Target Azi−Actual Azi

Accordingly, the desired toolface and proportion are set in thesteerable tool to control the direction of the drilling course. Giventhe drilling speed, the RSS is able to achieve its trajectory control inan improved manner. Those skilled in the art, with the benefit of thisdisclosure, will appreciate that above equations and control scheme areequally applicable to Vertical Drilling, Magnetic Kickoff, ConstantCurvature Drilling (Constant Build and/or Turn), and Tangent andHorizontal Drilling automation schemes.

LWD Recording Interval

The modern LWD imaging tool requires high-density, high-capacitydownhole memory to generate high-quality LWD image logs after thedrilling run (memory-based images). However, knowing the drilling speed(ROP) of the steering device, the LWD imaging tool may be able toconserve memory resource and intelligently manage its memory usage. Forexample, if the drilling becomes slower, the tool does not have torecord the image data in memory as frequently as when it drills faster.

The similar principle applies to the use of the bandwidth of the mudpulse telemetry. When the drilling becomes very slow, the LWD image datadoes not have to be pulsed up as frequently therefore, it can yield thetelemetry bandwidth to other tools.

Embodiments of drilling speed and depth computation for downhole toolsmay be implemented on virtually any type of computer regardless of theplatform being used. For instance, as shown in FIG. 5, a computer system(500) includes one or more processor(s) (502) such as a centralprocessing unit (CPU) or other hardware processor, associated memory(505) (e.g., random access memory (RAM), cache memory, flash memory,etc.), a storage device (506) (e.g., a hard disk, an optical drive suchas a compact disk drive or digital video disk (DVD) drive, a flashmemory stick, etc.), and numerous other elements and functionalitiestypical of today's computers (not shown). The computer (500) may alsoinclude input means, such as a keyboard (508), a mouse (510), or amicrophone (not shown). Further, the computer (500) may include outputmeans, such as a monitor (512) (e.g., a liquid crystal display LCD, aplasma display, or cathode ray tube (CRT) monitor). The computer system(500) may be connected to a network (515) (e.g., a local area network(LAN), a wide area network (WAN) such as the Internet, or any othersimilar type of network) via a network interface connection (not shown).Those skilled in the art will appreciate that many different types ofcomputer systems exist (e.g., workstation, desktop computer, a laptopcomputer, a personal media device, a mobile device, such as a cell phoneor personal digital assistant, or any other computing system capable ofexecuting computer readable instructions), and the aforementioned inputand output means may take other forms, now known or later developed.Generally speaking, the computer system (500) includes at least theminimal processing, input, and/or output means necessary to practice oneor more embodiments.

Further, those skilled in the art will appreciate that one or moreelements of the aforementioned computer system (500) may be located at aremote location and connected to the other elements over a network.Further, one or more embodiments may be implemented on a distributedsystem having a plurality of nodes, where each portion of theimplementation may be located on a different node within the distributedsystem. In one or more embodiments, the node corresponds to a computersystem. Alternatively, the node may correspond to a processor withassociated physical memory. The node may alternatively correspond to aprocessor with shared memory and/or resources. Further, softwareinstructions to perform one or more embodiments may be stored on acomputer readable medium such as a compact disc (CD), a diskette, atape, or any other computer readable storage device.

Drilling speed and depth computation for downhole tools has beendescribed with respect to a limited number of embodiments, those skilledin the art, having benefit of this disclosure, will appreciate thatother embodiments may be devised which do not depart from the scope ofdrilling speed and depth computation for downhole tools as disclosedherein. For example, equations listed throughout this disclosure may besolved using software, firmware, FPGA (Field-Programmable Gate Array),hardware (e.g., including analog or digital circuits), or combinationsthereof. Accordingly, the scope of drilling speed and depth computationfor downhole tools should be limited only by the attached claims.

What is claimed is:
 1. A method for managing a drilling operation in asubterranean formation, comprising: generating, by a first sensor of abottom hole assembly (BHA) and during the drilling operation, a firsttime based data log representing a borehole parameter along a drillingtrajectory; generating, by a second sensor of the BHA during thedrilling operation, a second time based data log representing theborehole parameter along the drilling trajectory; determining, by acomputer processor of the BHA and during the drilling operation, a timeshift by comparing the first time based data log and the second timebased data log, wherein offsetting the first and second time based datalogs by the time shift maximizes a correlation factor of the first andsecond time based data logs; determining, within a pre-determined timeperiod from generating the first and second time based data logs, adrilling speed based on the time shift and a pre-determined distancebetween the first sensor and the second sensor; and performing thedrilling operation based on the drilling speed.
 2. The method of claim1, further comprising: calculating, by the computer processor of the BHAand during the drilling operation, a difference between the first andsecond time based data logs based on X[T] and Y[T−t], wherein thecorrelation factor is inversely proportional to the difference, andwherein the time shift is determined based on at least one selected froma group consisting of${t = {{argmin}_{t\rightarrow N}\left( \frac{\sqrt{\sum\limits_{t = 1}^{N}\; \left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)^{2}}}{N} \right)}},\begin{matrix}{{t = {{argmin}_{t\rightarrow N}\left( {\sum\limits_{t = 1}^{N}\; \left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)^{2}} \right)}},{and}} \\{{t = {{argmin}_{t\rightarrow N}\left( {\sum\limits_{t = 1}^{N}\; {{abs}\left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)}} \right)}},}\end{matrix}$ where Σ represents a summation over N time points in thefirst time based data log, T represents one of the N time points, trepresents the time shift, X[T] represents a first normalized value ofthe first time based data log at T, and Y[T−t] represents a secondnormalized value of the second time based data log at T−t.
 3. The methodof claim 1, further comprising: dividing, by the computer processor ofthe BHA and within the pre-determined time period, the pre-determineddistance over the time shift to determine the drilling speed; resetting,by the computer processor of the BHA and within the pre-determined timeperiod, the drilling speed to a pre-determined level in response todetermining a vibration level of the BHA being less than apre-determined threshold; and determining, by the computer processor ofthe BHA and within the pre-determined time period, a drilling depth byat least mathematically integrating the drilling speed over time.
 4. Themethod of claim 1, further comprising: calculating, by the computerprocessor of the BHA and within the pre-determined time period, at leastone drilling parameter selected from a group consisting of build rate,turn rate, dogleg, and effective gravity toolface based on the drillingspeed; and adjusting, within a pre-determined time period fromgenerating the first and second time based data logs, at least oneselected from a group consisting of a toolface and a steering ratiobased on the at least one drilling parameter.
 5. The method of claim 1,further comprising: determining, during the drilling operation, aplurality of constant depth intervals based on the drilling speed; andadjusting, at the plurality of constant depth intervals, a gain of atleast one selected from a group consisting of a proportional controller,a proportional integral controller, and a proportional integraldifferential controller of a downhole steerable device to control atrajectory thereof.
 6. The method of claim 1, further comprising:determining, based on the drilling speed, a frequency for at least oneselected from a group consisting of storing output of a downhole imagingtool in a downhole memory of the BHA and sending the output of thedownhole imaging tool to a surface unit via mud pulse telemetry.
 7. Themethod of claim 1, further comprising: transmitting the drilling speedto a surface unit, wherein the drilling speed is compared, in thesurface unit, to a surface-determined drilling speed for calibration. 8.The method of claim 1, wherein the first sensor and the second sensorcomprise at least one selected from a group consisting of a formationevaluation sensor, a navigation sensor, a logging-while-drilling (LWD)sensor, a fluid sampling sensor, a pressure sensor, a temperaturesensor, a downhole camera, and a caliper sensor, and wherein the firsttime based data log and the second time based data log comprise at leastone selected from a group consisting of first time based data logone-dimensional data array, a multi-dimensional data array, azimuthaldata, and imaging data.
 9. The method of claim 1, further comprising:generating, by a third sensor of the BHA and during the drillingoperation, a third time based data log representing another boreholeparameter along the drilling trajectory; generating, by a fourth sensorof the BHA during the drilling operation, a fourth time based data logrepresenting the another borehole parameter along the drillingtrajectory; determining, by a computer processor of the BHA and duringthe drilling operation, another time shift by comparing the third timebased data log and the fourth time based data log, wherein offsettingthe third and fourth time based data logs by the another time shiftmaximizes another correlation factor of the third and fourth time baseddata logs; and validating the drilling speed based on the another timeshift and another pre-determined distance between the third sensor andthe fourth sensor, wherein the first sensor and the second sensor,comprise a formation evaluation sensor, and wherein the third sensor andthe fourth sensor comprise a navigational sensor.
 10. A bottom holeassembly (BHA), comprising: a first sensor configured to generate,during a drilling operation, a first time based data log representing aborehole parameter along a drilling trajectory; a second sensorconfigured to generate, during the drilling operation, a second timebased data log representing the borehole parameter along the drillingtrajectory; and a drilling speed calculator configured to: determine,during the drilling operation, a time shift by comparing the first timebased data log and the second time based data log, wherein offsettingthe first and second time based data logs by the time shift maximizes acorrelation factor of the first and second time based data logs; anddetermine, within a pre-determined time period from generating the firstand second time based data logs, a drilling speed based on the timeshift and a pre-determined distance between the first sensor and thesecond sensor, wherein the drilling operation is performed based on thedrilling speed.
 11. The BHA of claim 10, the drilling speed calculatorfurther configured to: calculate, during the drilling operation, adifference between the first and second time based data logs based onX[T]−Y[T−t], wherein the correlation factor is inversely proportional tothe difference, and wherein the time shift is determined based on atleast one selected from a group consisting of${t = {{argmin}_{t\rightarrow N}\left( \frac{\sqrt{\sum\limits_{t = 1}^{N}\; \left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)^{2}}}{N} \right)}},\begin{matrix}{{t = {{argmin}_{t\rightarrow N}\left( {\sum\limits_{t = 1}^{N}\; \left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)^{2}} \right)}},{and}} \\{{t = {{argmin}_{t\rightarrow N}\left( {\sum\limits_{t = 1}^{N}\; {{abs}\left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)}} \right)}},}\end{matrix}$ where Σ represents a summation over N time points in thefirst time based data log, T represents one of the N time points, trepresents the time shift, X[T] represents a first normalized value ofthe first time based data log at T, and Y[T−t] represents a secondnormalized value of the second time based data log at T−t.
 12. The BHAof claim 10, the drilling speed calculator further configured to:divide, within the pre-determined time period, the pre-determineddistance over the time shift to determine the drilling speed; reset,within the pre-determined time period, the drilling speed to apre-determined level in response to determining a vibration level of theBHA being less than a pre-determined threshold; and determine, withinthe pre-determined time period, a drilling depth by at leastmathematically integrating the drilling speed over time.
 13. The BHA ofclaim 10, further comprising a drilling parameter calculator configuredto: calculate, within the pre-determined time period, at least onedrilling parameter selected from a group consisting of build rate, turnrate, dogleg, and effective gravity toolface based on the drillingspeed, wherein at least one selected from a group consisting of atoolface and a steering ratio is adjusted, within a pre-determined timeperiod from generating the first and second time based data logs, basedon the at least one drilling parameter.
 14. The BHA of claim 10, furthercomprising a drilling parameter calculator configured to: determine,during the drilling operation, a plurality of constant depth intervalsbased on the drilling speed, wherein a gain of at least one selectedfrom a group consisting of a proportional controller, a proportionalintegral controller, and a proportional integral differential controllerof a downhole steerable device is adjusted to control a trajectorythereof at the plurality of constant depth intervals.
 15. The BHA ofclaim 10, further comprising a drilling parameter calculator configuredto: determine, based on the drilling speed, a frequency for at least oneselected from a group consisting of storing output of a downhole imagingtool in a downhole memory of the BHA and sending the output of thedownhole imaging tool to a surface unit via mud pulse telemetry.
 16. TheBHA of claim 10, the drilling speed calculator further configured to:transmit the drilling speed to a surface unit, wherein the drillingspeed is compared, in the surface unit, to a surface-determined drillingspeed for calibration.
 17. The BHA of claim 10, wherein the first sensorand the second sensor comprise at least one selected from a groupconsisting of a formation evaluation sensor, a navigation sensor, alogging-while-drilling (LWD) sensor, a fluid sampling sensor, a pressuresensor, a temperature sensor, a downhole camera, and a caliper sensor,and wherein the first time based data log and the second time based datalog comprise at least one selected from a group consisting of first timebased data log one-dimensional data array, a multi-dimensional dataarray, azimuthal data, and imaging data.
 18. The BHA of claim 10,further comprising: a third sensor configured to generate, during thedrilling operation, a third time based data log representing anotherborehole parameter along the drilling trajectory; and a fourth sensorconfigured to generate, during the drilling operation, a fourth timebased data log representing the another borehole parameter along thedrilling trajectory, the drilling speed calculator further configuredto: validate the drilling speed based on the another time shift andanother pre-determined distance between the third sensor and the fourthsensor, wherein the first sensor and the second sensor comprise aformation evaluation sensor, and wherein the third sensor and the fourthsensor comprise a navigational sensor.
 19. A non-transitory computerreadable medium storing instructions for managing drilling operation ina subterranean formation, the instructions when executed causing aprocessor of a bottom hole assembly (BHA) to: generate, by a firstsensor of the BHA and during the drilling operation, a first time baseddata log representing a borehole parameter along a drilling trajectory;generate, by a second sensor of the BHA during the drilling operation, asecond time based data log representing the borehole parameter along thedrilling trajectory; determine, during the drilling operation, a timeshift by comparing the first time based data log and the second timebased data log, wherein offsetting the first and second time based datalogs by the time shift maximizes a correlation factor of the first andsecond time based data logs; determine, within a pre-determined timeperiod from generating the first and second time based data logs, adrilling speed based on the time shift and a pre-determined distancebetween the first sensor and the second sensor; and perform the drillingoperation based on the drilling speed.
 20. The non-transitory computerreadable medium of claim 19, the instructions when executed furthercausing the processor of the BHA to: calculate, during the drillingoperation, a difference between the first and second time based datalogs based on X[T] and Y[T−t], wherein the correlation factor isinversely proportional to the difference, and wherein the time shift isdetermined based on at least one selected from a group consisting of${t = {{argmin}_{t\rightarrow N}\left( \frac{\sqrt{\sum\limits_{t = 1}^{N}\; \left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)^{2}}}{N} \right)}},\begin{matrix}{{t = {{argmin}_{t\rightarrow N}\left( {\sum\limits_{t = 1}^{N}\; \left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)^{2}} \right)}},{and}} \\{{t = {{argmin}_{t\rightarrow N}\left( {\sum\limits_{t = 1}^{N}\; {{abs}\left( {{X\lbrack T\rbrack} - {Y\left\lbrack {T - t} \right\rbrack}} \right)}} \right)}},}\end{matrix}$ where Σ represents a summation over N time points in thefirst time based data log, T represents one of the N time points, trepresents the time shift, X[T] represents a first normalized value ofthe first time based data log at T, and Y[T−t] represents a secondnormalized value of the second time based data log at T−t.